import java.io.IOException;

import org.kwis.msp.lcdui.Jlet;
import org.kwis.msp.lcdui.Display;
import org.kwis.msp.lcdui.Image   ;

import org.kwis.msp.lwc.CommandBarComponent   ;
import org.kwis.msp.lwc.Command   ;
import org.kwis.msp.lwc.ShellComponent;

public class CommandBarEx1 extends Jlet{

	Display displayLCD ;
		

	public CommandBarEx1(){     }

	protected void startApp(String[] arg0){

		
		
		displayLCD = Display.getDefaultDisplay();
		ShellComponent shell = new ShellComponent();

		Image imgCMD1 = null;
		Image imgCMD2 = null;
		Image imgCMD3 = null;
		try {
			imgCMD1 = Image.createImage("/house.gif");
			imgCMD2 = Image.createImage("/friend.gif");
			imgCMD3 = Image.createImage("/telephone.gif");
		} catch (IOException e) {
			System.out.println(e);
		}

		CommandBarComponent cmdBar = new CommandBarComponent();
		Command cmd1 = new Command("주택정보",imgCMD1,null);
		Command cmd2 = new Command("친구찾기",imgCMD2, null);
		Command cmd3 = new Command("전화번호 검색" , imgCMD3, null);

		cmdBar.addCommand(cmd1);
		cmdBar.addCommand(cmd2);
		cmdBar.addCommand(cmd3);

		cmdBar.setActiveIndex(0);

		shell.setCommand(cmdBar,false);
		displayLCD.pushCard(shell.getCard());
		
	
	}

	protected void destroyApp(boolean arg0) {

	}


}
